<%@ page language="java" pageEncoding="utf-8"%>
<%@page import="com.farm.web.constant.FarmConstant"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="/view/conf/farmtag.tld" prefix="PF"%>
<style>
.nav-tabs a {
	font-weight: 700;
}
</style>
<style>
.wlp-userspace-h1 {
	font-size: 36px;
	text-align: center;
}

.picLUp {
	width: 100%;
	background-size: 100% 100%;
	color: white;
	background-color: #424f5c;
}

.wpl-class-tab .nav  li a {
	color: #ffffff;
}

.wpl-class-tab .nav  li .wlp-tab-drop-a {
	color: #333333;
}

.wpl-class-tab .nav  li a:HOVER {
	color: #666666;
}

.wpl-class-tab .nav  li a:FOCUS {
	color: #666666;
}

.wpl-class-tab .nav .active a {
	color: #666666;
}

.wlp-hour-box:HOVER {
	background-color: #fef3f3;
	color: #f20d0d;
}

.wlp-hour-box {
	padding: 4px;
	padding-top: 8px;
	cursor: pointer;
}
</style>
<ul class="nav nav-tabs" id="tabs-main-nav" style="margin-top: 20px;">
	<c:if test="${!empty classview.introText }">
		<li role="presentation" ${param.current=='home'?'class="active"':'' }><a
			href="classweb/Pubview.do?classid=${classview.classt.id }">课程 </a></li>
	</c:if>
	<li role="presentation"
		${param.current=='chapter'?'class="active"':'' }><a
		id="backTabLi"
		href="classweb/Pubview.do?type=chapter&classid=${classview.classt.id }">目录
	</a></li>
	<li role="presentation"
		${param.current=='comments'?'class="active"':'' }><a
		id="backTabLi"
		href="classweb/Pubview.do?type=comments&classid=${classview.classt.id }">评论
	</a></li>
	<li role="presentation"
		${param.current=='evaluation'?'class="active"':'' }><a
		id="backTabLi"
		href="classweb/Pubview.do?type=evaluation&classid=${classview.classt.id }">评价
	</a></li>
	<c:forEach items="${resources}" var="node">
		<c:set var="isCpage" value="0"></c:set>
		<!-- 最大化的资源按钮 -->
		<c:if
			test="${(node.model=='WTS'&&(node.resourcetype=='3'||node.resourcetype=='4'))||(node.model=='WCP'&&(node.resourcetype=='1'||node.resourcetype=='2'))}">
			<!-- 当前页展示 -->
			<li role="presentation" class="hidden-xs"><a target="_blank"
				style="cursor: pointer;"
				onclick="loadTabContent('${node.bindResourceId}',this)"> <i
					class="glyphicon ${node.resourceicon}"></i>&nbsp;&nbsp;${node.apptypename}${node.resourcename}
			</a></li>
			<c:set var="isCpage" value="1"></c:set>
		</c:if>
		<c:if
			test="${isCpage==0}">
			<!-- 新窗口展示 -->
			<li role="presentation" class="hidden-xs"><a target="_blank"
				style="cursor: pointer;"
				onclick="goOutsys('${node.baseurl}${node.resourceurl}')"><i
					class="glyphicon ${node.resourceicon}"></i>&nbsp;&nbsp;${node.apptypename}${node.resourcename }
			</a></li>
		</c:if>
	</c:forEach>
	<c:if test="${!empty resources}">
		<!-- 最小化的资源按钮 -->
		<li role="presentation"
			class="dropdown  hidden-lg hidden-md hidden-sm"><a href="#"
			id="myTabDrop1" class="dropdown-toggle" data-toggle="dropdown"
			aria-controls="myTabDrop1-contents" aria-expanded="false">资源 <span
				class="caret"></span>
		</a>
			<ul class="dropdown-menu" aria-labelledby="myTabDrop1"
				id="myTabDrop1-contents">
				<c:forEach items="${resources}" var="node">
					<li><a target="_blank" class="wlp-tab-drop-a"
						style="cursor: pointer;"
						onclick="goOutsys('${node.baseurl}${node.resourceurl}')">${node.apptypename}${node.resourcename }
					</a></li>
				</c:forEach>
			</ul></li>
	</c:if>
	<li role="presentation" class="hidden-xs"><a target="_blank"
		data-toggle="modal" data-target="#shareUrlWin"
		style="cursor: pointer;"><i class="glyphicon glyphicon-share"></i>&nbsp;分享
	</a> <!-- 分享功能弹出窗口 -->
		<div class="modal fade" id="shareUrlWin" tabindex="-1" role="dialog"
			aria-labelledby="myModalLabel">
			<div class="modal-dialog" role="document">
				<div class="modal-content"
					style="padding-left: 20px; padding-right: 20px;">
					<script type="text/javascript">
						function shareUrlDefault() {
							return '<PF:basePath/>classweb/Pubview.do?classid=${classview.classt.id }';
						}
					</script>
					<jsp:include page="/view/web-simple/hour/commons/shareUrl.jsp"></jsp:include>
				</div>
			</div>
		</div></li>
	<c:if test="${writeAble}">
		<li role="presentation"
			${param.current=='userinfo'?'class="active"':'home' }><a
			id="backTabLi"
			href="classweb/Pubview.do?type=userinfo&classid=${classview.classt.id }">学员
		</a></li>
	</c:if>
</ul>

<script type="text/javascript">
	function goOutsys(url) {
		window.open(url);
	}
	//在当前页面展示资源内容
	function loadTabContent(bindResourceId, thisObj) {
		$('#tab-main-content').html("...");
		$('#tab-main-content').load(
				"resourceweb/PubLoad.do?resourceid=" + bindResourceId, {},
				function() {
					$('li', '#tabs-main-nav').removeClass('active');
					$(thisObj).parent('li').addClass('active');
				});
	}
</script>